"""
房间 VO
"""

from models import (
    VOBase,
    VOPage,
)
from models.other import (
    Dimensions,
    Vector3D,
)
from my_typing import *
from utils.data_utils.special import ObjectIdStr
from utils.mock_utils import Demo
from utils.validator_utils.pydantic_validator.field import (
    CharField,
    DecimalField,
    NormalField,
)


class FamilyRoomListVO(VOBase):
    """ 家庭 | 房间 | 列表 | VO """

    room_id: ObjectIdStr = CharField(..., title="房间 ID（ObjectId 字符串）", examples=[Demo.id])

    alias: StrOrNone = CharField(None, title="别名", min_length=3, max_length=32)
    dimensions: Dimensions | None = NormalField(..., description="房间的尺寸（长宽高）")
    home_id: ObjectIdStr = CharField(..., title="家 ID（ObjectId 字符串）", examples=[Demo.id])
    name: str = CharField(..., title="名称", min_length=1, max_length=32)
    position_2_home: Vector3D | None = NormalField(None, title="位置（对于家来说）")
    update_time: str = CharField(..., title="更新时间", min_length=19, max_length=19, examples=[Demo.dt_str])


class FamilyRoomDetailVO(FamilyRoomListVO):
    """ 家庭 | 房间 | 详情 | VO """

    area: FloatOrNone = DecimalField(None, title="面积", min_value=10, max_value=1000)
    create_time: str = CharField(..., title="创建时间", min_length=19, max_length=19, examples=[Demo.date_str])
    description: StrOrNone = CharField(None, title="描述", max_length=256)


class FamilyRoomListPage(VOPage[FamilyRoomListVO]):
    """ 家庭 | 房间 | 列表 | 分页 """
